package com.easyj.admin.db.mapper;

import com.easyj.admin.db.model.Group;
import com.easyj.admin.db.model.GroupUser;
import com.easyj.admin.db.model.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GroupUserMapper {
    long countByExample(GroupUser example);

    int deleteByPrimaryKey(Long id);

    int insert(GroupUser record);

    int insertSelective(GroupUser record);

    List<GroupUser> selectByExample(GroupUser example);

    GroupUser selectUniqueByUnqueInx(@Param("userId") Long userId, @Param("groupId") Long groupId);

    GroupUser selectByPrimaryKey(Long id);
    
    List<User> selectUsersByGroupId(Long groupId);
    
    List<User> selectTop5UsersByGroupId(Long groupId);

    List<User> selectUsersByGroupCode(String groupCode);
    
    int deleteByGropuId(Long groupId);
    
    long countByGropuId(Long groupId);
    
    List<Group> selectGroupsByUserId(Long userId);
}